package site.assad.aspectj.example;

import org.aspectj.lang.annotation.AfterThrowing;
import org.aspectj.lang.annotation.Aspect;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/12/5 20:26
 * Description: @AfterThrowing 抛出增强切面类
 */
@Aspect
public class AfterThrowingAspect {

    @AfterThrowing(pointcut = "site.assad.common.ThrowExceptionTarget.ohShit()",
                   throwing = "ex")
    public void afterThrowException(UnsupportedOperationException ex){
        System.out.println("Exception message:"+ex.getClass().getName()+":"+ex.getMessage());
    }
}
